home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / Input / IFOParser / print_ifo_audio.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-08  |  2.9 KB  |  116 lines

  1.  
  2. /*
  3.  * GET AUDIO INFORMATION
  4.  *
  5.  * Copyright (C) 1998,1999,2000  Thomas Mirlacher
  6.  *
  7.  * This program is free software; you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License as published by
  9.  * the Free Software Foundation; either version 2 of the License, or
  10.  * (at your option) any later version.
  11.  * 
  12.  * This program is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16.  * 
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with this program; if not, write to the Free Software
  19.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  * 
  21.  * The author may be reached as dent@cosy.sbg.ac.at, or
  22.  * Thomas Mirlacher, Jakob-Haringerstr. 2, A-5020 Salzburg,
  23.  * Austria
  24.  *
  25.  *------------------------------------------------------------
  26.  *
  27.  */
  28. #include "IFOparser.h"
  29. extern CIFOParser *IFOGlobal;
  30.  
  31. #include <stdio.h>
  32. #include <string.h>
  33.  
  34. #include <stdlib.h>
  35. #include <sys/types.h>
  36. //#include <unistd.h>
  37. #include "ifo.h"
  38.  
  39. #include "misc.h"
  40. #include "decode.h"
  41.  
  42.  
  43. /**
  44.  *
  45.  */
  46.  
  47. void ifoPrintAudio (ifo_audio_t *audio, u_int num)
  48. {
  49.     int i;
  50.  
  51.     if (!audio)
  52.         return;
  53.  
  54.     printf ("\nAUDIO\n");
  55.     printf ("---\n");
  56.  
  57.     printf ("number of streams:\t%d\n", num);
  58.     IFOGlobal->AudioCount = num;
  59.     if(IFOGlobal->AudioCount>8)
  60.         IFOGlobal->fatal_error_flag = 1;
  61.  
  62.     for (i=0; i<num; i++) {
  63.         char *appl_mode;
  64.         char *caption;
  65.  
  66. { int i;
  67.   u_char *ptr = (u_char *) audio;
  68.  
  69.   for (i=0; i<IFO_AUDIO_LEN; i++)
  70.     printf ("%02x ", *ptr++);
  71. }
  72.  
  73. //        if (audio->type) // language included
  74.             printf ("\tlang_code:\t%s\n",   ifoDecodeLang (audio->lang_code));
  75.             strcpy(IFOGlobal->AudioID[i], ifoDecodeLang (audio->lang_code));
  76. //        else
  77. //            printf ("\tno language specified in stream\n");
  78.         IFOGlobal->AudioMode[i]  = audio->coding_mode&0x07;
  79.         printf ("\tmode:\t\t%s(%dCh)%s\n",
  80.             decode_audiomode (audio->coding_mode),
  81.             audio->num_channels+1,
  82.             audio->multichannel_extension ? "+multichannel" : ""
  83.             );
  84.  
  85.         printf ("\tsampling:\t%dkHz\n", audio->sample_freq ? 96 : 48);
  86.  
  87.         if ((appl_mode = decode_audiomodeappl (audio->appl_mode1<<1 | audio->appl_mode2)))
  88.             printf ("\tappl_mode:\t%s\n", appl_mode);
  89.         if ((caption = decode_caption (audio->caption))){
  90.             printf ("\tcaption:\t%s\n", caption);
  91.             strcat(IFOGlobal->AudioID[i], " (");
  92.             strcat(IFOGlobal->AudioID[i], decode_caption (audio->caption));
  93.             strcat(IFOGlobal->AudioID[i], ")");
  94.         }
  95.  
  96.         printf ("\tquant:\t\t");
  97.         switch (audio->quantization) {
  98.             case 0x00:
  99.                 printf ("16bit");
  100.                 break;
  101.             case 0x01:
  102.                 printf ("20bit");
  103.                 break;
  104.             case 0x02:
  105.                 printf ("24bit");
  106.                 break;
  107.             case 0x03:
  108.                 printf ("DRC");
  109.                 break;
  110.         }
  111.         printf ("\n");
  112.  
  113.         audio++;    
  114.     }
  115. }
  116.